var tableData = {
	url : ctp + "/attendanceController/attendanceSearch.shtml",
	propertys : [ "ORG_NAME","ENGINEER_NAME","TIMES","SIGN_TIME","SIGNOUT_TIME","SIGN_TIME2","SIGNOUT_TIME2","PERSON_NUMBER"],
	 hrefs:[["function=attendanceUpdate","recId=REC_ID","修改",null],["function=attendanceDel","recId=REC_ID","删除",null]],
	startLoad : function() {
		getListData(this);
	}
};
function searchData(curr) {
	setTagAndValue("form1", "curr", curr);
	tableData.startLoad();
}
$(document).ready(function() {
	searchData();
});

function attendanceUpdate(recId) {
	location.href = ctp + "/attendanceController/attendanceUpdate.shtml?recId="+recId;
	/*layui.layer.open({
        type: 2,
        area: ['1000px', '510px'],
        title: "修改考勤排班",
        fixed: false,
        maxmin: false,
        content: ctp + "/attendanceController/attendanceUpdate.shtml?recId="+recId
    });*/
}
function attendanceDel(recId){
	jconfirm("del('"+recId+"')","是否要删除所选记录？");
}
function moduleDel(){
	var recIds=getCheckIds();	
	if(recIds==''){
		jalert("请选择记录！");
		return false;
	}
	jconfirm("del('"+recIds+"')","是否要删除所选记录？");	
}
function del(recIds){
	 $.ajax({ 
		 	url: ctp + "/attendanceController/attendanceDelete.shtml",
		    data: {recIds:recIds},
			type : 'POST',
			async:false, 
			success : function(result) {  
				if(result=="") {  
					jalert9("所选择的记录删除成功！"); 		
					  var curr = "1";
					  if($("#form1").find("#curr").length>0){
						  curr = $("#curr").val();
					  }
					  searchData(curr);
				} 		  
				else{     
					jalert(result);   
				} 
	  		}
		});
}

function attendanceAdd(){
	location.href = ctp + "/attendanceController/attendanceAdd.shtml";
	
	/*dialogWin(650, 450, ctp + "/attendanceController/attendanceAdd.shtml", "");*/
/*	layui.layer.open({
        type: 2,
        area: ['1000px', '510px'],
        title: "新增考勤排班",
        fixed: false,
        maxmin: false,
        content: ctp + "/attendanceController/attendanceAdd.shtml"
    });*/
}



